cmake_minimum_required(VERSION 3.5.1)
project(liblds
	VERSION 1.0.1
	LANGUAGES C
)

set(LIBS_DIR ${PROJECT_SOURCE_DIR}/libs) # 库保存目录
set(INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include/) # 头文件目录
set(PUBLIC_DEMO ${PROJECT_SOURCE_DIR}/src/PublicDemo/) # 公用代码目录
option(BUILD_TOTAL OFF) # 默认构建多个库
if(LINUX)
	add_compile_options(-Wall)  # 编译时显示所有的警告
	add_compile_options(-O2)    # 开启优化
	add_compile_options(-std=c11)
	add_definitions(-D _LINUX_PLATFORM_) # LINUX 平台宏，用于专门为Linux编写的代码
	if(NOT DEFINED INSTALL_DIR)
		set(INSTALL_DIR /usr/local/)
	endif()
endif()

message(STATUS "Install dir = ${INSTALL_DIR}")
set(LIBRARY_OUTPUT_PATH ${LIBS_DIR})

add_subdirectory(src/List/)  # 表
add_subdirectory(src/Stack/) # 栈
add_subdirectory(src/Queue/) # 队列
add_subdirectory(src/Tree/)  # 树
add_subdirectory(src/Sort/)  # 排序
